home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Macro assembler dev syst.adf / include / libraries / dos.i < prev    next >
Text File  |  1985-12-20  |  6KB  |  156 lines

  1.    IFND LIBRARIES_DOS_I
  2. LIBRARIES_DOS_I            SET      1
  3.  
  4. ********************************************************************
  5. *               Commodore-Amiga, Inc.                              *
  6. *               dos.i                                              *
  7. ********************************************************************
  8. * Standard assembler header for Amiga DOS on the MC68000   
  9.  
  10. *      IFND EXEC_TYPES_I
  11. *      INCLUDE "exec/types.i"
  12. *      ENDC
  13.  
  14.  
  15. DOSNAME     MACRO
  16.       DC.B  'dos.library',0
  17.       ENDM
  18.  
  19. * Predefined Amiga DOS global constants 
  20.  
  21. * Mode parameter to Open() 
  22. MODE_OLDFILE         EQU   1005   * Open existing file read/write 
  23. *                                 * positioned at beginning of file. 
  24. MODE_NEWFILE         EQU   1006   * Open freshly created file (delete 
  25. *                                 * old file) read/write            
  26.  
  27. * Relative position to Seek() 
  28. OFFSET_BEGINNING     EQU   -1     * relative to Beginning Of File 
  29. OFFSET_CURRENT       EQU    0     * relative to Current file position 
  30. OFFSET_END           EQU    1     * relative to End Of File    
  31.  
  32. OFFSET_BEGINING      EQU   OFFSET_BEGINNING     * Ancient compatibility
  33.  
  34. BITSPERBYTE          EQU   8
  35. BYTESPERLONG         EQU   4
  36. BITSPERLONG          EQU   32
  37. MAXINT               EQU   $7FFFFFFF
  38. MININT               EQU   $80000000
  39.  
  40. * Passed as type to Lock() 
  41. SHARED_LOCK          EQU   -2    ; File is readable by others 
  42. ACCESS_READ          EQU   -2    ; Synonym
  43. EXCLUSIVE_LOCK       EQU   -1    ; No other access allowed    
  44. ACCESS_WRITE         EQU   -1    ; Synonym
  45.  
  46.  
  47.  STRUCTURE DateStamp,0 
  48.    LONG  ds_Days                 ; Number of days since Jan. 1, 1978
  49.    LONG  ds_Minute               ; Number of minutes past midnight 
  50.    LONG  ds_Tick                 ; Number of ticks past minute 
  51.    LABEL ds_SIZEOF               ; DateStamp 
  52. TICKS_PER_SECOND EQU 50          ; Number of ticks in one second 
  53.  
  54. * Returned by Examine() and ExInfo() 
  55.  STRUCTURE FileInfoBlock,0
  56.    LONG   fib_DiskKey
  57.    LONG   fib_DirEntryType       ; Type of Directory. If <0, then a plain file
  58.                                  ; If > 0 then a directory 
  59.    STRUCT fib_FileName,108       ; Null terminated. Max 30 chars used for now 
  60.    LONG   fib_Protection         ; bit mask of protection, rwxd are 3-0.      
  61.    LONG   fib_EntryType
  62.    LONG   fib_Size               ; Number of bytes in file 
  63.    LONG   fib_NumBlocks          ; Number of blocks in file 
  64.    STRUCT fib_DateStamp,ds_SIZEOF ; Date file last changed.
  65.    STRUCT fib_Comment,116        ; Null terminated. 
  66.                                  ; Comment associated with file 
  67.    LABEL  fib_SIZEOF             ; FileInfoBlock 
  68.  
  69. * FIB stands for FileInfoBlock 
  70. * FIBB are bit definitions, FIBF are field definitions 
  71.    BITDEF   FIB,READ,3
  72.    BITDEF   FIB,WRITE,2
  73.    BITDEF   FIB,EXECUTE,1
  74.    BITDEF   FIB,DELETE,0
  75.  
  76.  
  77. * All BCPL data must be long word aligned.  BCPL pointers are the long word
  78. * address (i.e byte address divided by 4 (>>2))
  79.  
  80. * Macro to indicate BCPL pointers
  81. BPTR     MACRO                      * Long word pointer
  82.          LONG     \1
  83.          ENDM
  84. BSTR     MACRO                      * Long word pointer to BCPL string.
  85.          LONG     \1
  86.          ENDM
  87.  
  88. * #define BADDR( bptr ) (bptr << 2) * Convert BPTR to byte addressed pointer
  89.  
  90. * BCPL strings have a length in the first byte and then the characters.
  91. * For example:  s[0]=3 s[1]=S s[2]=Y s[3]=S
  92.  
  93. * returned by Info() 
  94.  STRUCTURE InfoData,0
  95.    LONG id_NumSoftErrors      * number of soft errors on disk 
  96.    LONG id_UnitNumber         * Which unit disk is (was) mounted on 
  97.    LONG id_DiskState          * See defines below 
  98.    LONG id_NumBlocks          * Number of blocks on disk 
  99.    LONG id_NumBlocksUsed      * Number of block in use 
  100.    LONG id_BytesPerBlock   
  101.    LONG id_DiskType           * Disk Type code
  102.    BPTR id_VolumeNode         * BCPL pointer to volume node
  103.    LONG id_InUse              * Flag, zero if not in use
  104.    LABEL id_SIZEOF            * InfoData 
  105.  
  106. * ID stands for InfoData 
  107. *            Disk states
  108. ID_WRITE_PROTECTED   EQU   80 * Disk is write protected 
  109. ID_VALIDATING        EQU   81 * Disk is currently being validated 
  110. ID_VALIDATED         EQU   82 * Disk is consistent and writeable 
  111. *          Disk types 
  112. ID_NO_DISK_PRESENT   EQU -1
  113. ID_UNREADABLE_DISK   EQU  ('B'<<24)!('A'<<16)!('D'<<8)
  114. ID_NOT_REALLY_DOS    EQU  ('N'<<24)!('D'<<16)!('O'<<8)!('S')
  115. ID_DOS_DISK          EQU  ('D'<<24)!('O'<<16)!('S'<<8)
  116. ID_KICKSTART_DISK    EQU  ('K'<<24)!('I'<<16)!('C'<<8)!('K')
  117.  
  118. * Errors from IoErr(), etc. 
  119. ERROR_NO_FREE_STORE               EQU  103
  120. ERROR_OBJECT_IN_USE               EQU  202
  121. ERROR_OBJECT_EXISTS               EQU  203
  122. ERROR_OBJECT_NOT_FOUND            EQU  205
  123. ERROR_ACTION_NOT_KNOWN            EQU  209
  124. ERROR_INVALID_COMPONENT_NAME      EQU  210
  125. ERROR_INVALID_LOCK                EQU  211
  126. ERROR_OBJECT_WRONG_TYPE           EQU  212
  127. ERROR_DISK_NOT_VALIDATED          EQU  213
  128. ERROR_DISK_WRITE_PROTECTED        EQU  214
  129. ERROR_RENAME_ACROSS_DEVICES       EQU  215
  130. ERROR_DIRECTORY_NOT_EMPTY         EQU  216
  131. ERROR_DEVICE_NOT_MOUNTED          EQU  218
  132. ERROR_SEEK_ERROR                  EQU  219
  133. ERROR_COMMENT_TOO_BIG             EQU  220   
  134. ERROR_DISK_FULL                   EQU  221
  135. ERROR_DELETE_PROTECTED            EQU  222
  136. ERROR_WRITE_PROTECTED             EQU  223 
  137. ERROR_READ_PROTECTED              EQU  224
  138. ERROR_NOT_A_DOS_DISK              EQU  225
  139. ERROR_NO_DISK                     EQU  226
  140. ERROR_NO_MORE_ENTRIES             EQU  232
  141.  
  142. * These are the return codes used by convention by AmigaDOS commands 
  143. * See FAILAT and IF for relvance to EXECUTE files                    
  144. RETURN_OK                         EQU    0  * No problems, success 
  145. RETURN_WARN                       EQU    5  * A warning only 
  146. RETURN_ERROR                      EQU   10  * Something wrong 
  147. RETURN_FAIL                       EQU   20  * Complete or severe failure
  148.  
  149. * Bit numbers that signal you that a user has issued a break
  150.    BITDEF   SIGBREAK,CTRL_C,12
  151.    BITDEF   SIGBREAK,CTRL_D,13
  152.    BITDEF   SIGBREAK,CTRL_E,14
  153.    BITDEF   SIGBREAK,CTRL_F,15
  154.  
  155.    ENDC LIBRARIES_DOS_I
  156.